<? require_once('classes/Craigslist.php'); 


$craig = new Craigslist();

//$craig_r = $craig->fetch($_GET);



?>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
  <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>Google Maps JavaScript API Example: Simple Map</title>
    <script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=ABQIAAAAREkopdB2DthaLKWLXUcWgxQoU8h1rNpuPlavOloCdSisrcvaLRTN2drNPlHMzM4OcpCreBqE1PmA8g"
            type="text/javascript"></script>
    
    
    
    
    <script type="text/javascript">

    var map;
    var geocoder;

		var restaurant = "The Old Mohawk Restaurant";
   var address = "821 Mohawk Street, Columbus OH";


    function initialize() {


		// Create new map object
      map = new GMap2(document.getElementById("map"));

      // Create new geocoding object
      geocoder = new GClientGeocoder();

      // Retrieve location information, pass it to addToMap()
      geocoder.getLocations(address, addToMap);

			var restaurant = "The Old Mohawk Restaurant";
	   var address = "821 Mohawk Street, Columbus OH";




 /*     map = new GMap2(document.getElementById("map_canvas"));
      //map.setCenter(new GLatLng(34, 0), 1);
      geocoder = new GClientGeocoder();
      map.setCenter(new GLatLng(40.80601358609009, -73.9463996887207), 14);
      map.setUIToDefault();
 			var myCounter = new Counter();
 			GEvent.addListener(map,"click", function(overlay, latlng) {     
			  
			  //alert(this.Placemark.Point.coordinates[0]);
			  
			  if (latlng) { 
			    var myHtml = "The GPoint value is: " + latlng + map.fromLatLngToDivPixel(latlng) + " at zoom level " + map.getZoom();
			    map.openInfoWindow(latlng, myHtml);
			  }
			});
			map.addControl(new GSmallMapControl());
			map.addControl(new GMapTypeControl());
			
			var address;
			 // Create new geocoding object
      geocoder = new GClientGeocoder();

      

			
			

			// Add 10 markers to the map at random locations
			var bounds = map.getBounds();
			var southWest = bounds.getSouthWest();
			var northEast = bounds.getNorthEast();
			var lngSpan = northEast.lng() - southWest.lng();
			var latSpan = northEast.lat() - southWest.lat();
			for (var i = 0; i < 10; i++) {
			  			var point = new GLatLng(southWest.lat() + latSpan * Math.random(),southWest.lng() + lngSpan * Math.random());
							//map.addOverlay(new GMarker(point));
							
							var marker = new Array();
							marker[i] = new GMarker(point, {draggable: true});
							GEvent.addListener(marker[i], "click", function() {
							  //map.closeInfoWindow();
							 this.openInfoWindowHtml("Just waiting for my information to show it to my canim banim...");
								
							// Retrieve location information, pass it to addToMap()
      				geocoder.getLocations("30 West at Rector New York Ny US", addToMap);	
								
							  //alert('click');
							  
							  });
							
							
							//	GEvent.addListener(marker[i], "dragend", function() {
							// marker[i].openInfoWindowHtml("Just bouncing along...");
							// });

							
							map.addOverlay(marker[i]);
							
							
							
							
			}
*/
			
    }

		function addToMap(response)
   {
      // Retrieve the object
      place = response.Placemark[0];

      // Retrieve the latitude and longitude
      point = new GLatLng(place.Point.coordinates[1],
                          place.Point.coordinates[0]);

      // Center the map on this point
      map.setCenter(point, 13);

      // Create a marker
      marker = new GMarker(point);

      // Add the marker to map
      map.addOverlay(marker);

      // Add address information to marker
      marker.openInfoWindowHtml(place.address);
   }
    
    
    
    
    /*

    // addAddressToMap() is called when the geocoder returns an
    // answer.  It adds a marker to the map with an open info window
    // showing the nicely formatted version of the address and the country code.
    function addAddressToMap(response) {
      //map.clearOverlays();
      if (!response || response.Status.code != 200) {
        alert("Sorry, we were unable to geocode that address");
      } else {
        place = response.Placemark[0];
        point = new GLatLng(place.Point.coordinates[1],
                            place.Point.coordinates[0]);
        marker = new GMarker(point);
        map.addOverlay(marker);
        marker.openInfoWindowHtml(place.address + '<br>' +
          '<b>Country code:</b> ' + place.AddressDetails.Country.CountryNameCode);
      }
    }

    // showLocation() is called when you click on the Search button
    // in the form.  It geocodes the address entered into the form
    // and adds a marker to the map at that location.
    function showLocation() {
      var address = document.forms[0].q.value;
      geocoder.getLocations(address, addAddressToMap);
    }

   // findLocation() is used to enter the sample addresses into the form.
    function findLocation(address) {
      document.forms[0].q.value = address;
      showLocation();
    }
*/
    </script>

  </head>

  <body onload="initialize()" onunload="GUnload()">
    
    
<form action="" method="get" onsubmit="ckCAbb();">

		<table width="100%" cellpadding="2" style="white-space: nowrap; background:#eee; border:1px solid gray;" summary="">
		<tr>
			<td align="right" width="1">search for:</td>
			<td width="30%"><input id="query" name="query" size="30" value=""> in:
				<select id="cAbb" name="catAbbreviation">

<option value="ccc">all community<option value="eee">all event<option value="sss">all for sale / wanted<option value="ggg">all gigs<option value="hhh">all housing<option disabled value="">--<option value="aap" selected>   all apartments
<option value="hsw">   all housing wanted
<option value="nfa">   all no fee apts
<option value="fee">   apts broker fee
<option value="nfb">   apts broker no fee
<option value="abo">   apts by owner

<option value="aiv">   apts registration fee
<option value="hou">   apts wanted
<option value="swp">   housing swap
<option value="off">   office &amp; commercial
<option value="prk">   parking &amp; storage
<option value="rea">   real estate - all
<option value="reb">   real estate - by broker

<option value="reo">   real estate - by owner
<option value="rew">   real estate wanted
<option value="roo">   rooms &amp; shares
<option value="sha">   rooms wanted
<option value="sbw">   sublet/temp wanted
<option value="sub">   sublets &amp; temporary
<option value="vac">   vacation rentals

<option disabled value="">--<option value="jjj">all jobs<option value="ppp">all personals<option value="res">all resume<option value="bbb">all services offered</select>
				<input type="submit" value="Search">
			</td><td>
				<label><input type="checkbox" name="srchType" value="T"
					title="check this box to search only posting titles"> only search titles</label>
			</td>
		</tr>

	
		<tr>
			<td align="right" width="1">rent:</td>
			<td><input name="minAsk" size="6" value="1500">&nbsp;<input name="maxAsk" size="6" value="1600">&nbsp;&nbsp;&nbsp;<select name="bedrooms">
<option value="">0+ BR
<option value="1" selected>1 BR
<option value="2">2 BR
<option value="3">3 BR
<option value="4">4 BR
<option value="5">5 BR
<option value="6">6 BR
<option value="7">7 BR
<option value="8">8 BR
</select>

<select name="neighborhood"><option value="">all neighborhoods
<option value="120" selected>Battery Park
<option value="134">Chelsea
<option value="160">Chinatown / Lit Italy
<option value="121">Downtown
<option value="159">East Harlem
<option value="129">East Village
<option value="122">Financial District
<option value="133">Flatiron
<option value="132">Gramercy
<option value="127">Greenwich Village
<option value="141">Harlem / Morningside
<option value="140">Inwood / Wash Hts
<option value="126">Lower East Side
<option value="135">Midtown
<option value="136">Midtown East
<option value="137">Midtown West

<option value="131">Murray Hill
<option value="125">Nolita / Bowery
<option value="124">SoHo
<option value="123">TriBeCa
<option value="130">Union Square
<option value="139">Upper East Side
<option value="138">Upper West Side
<option value="128">West Village
</select>
&nbsp;&nbsp;&nbsp;
				<label><input type="checkbox" name="addTwo"  value="purrr">cats</label>
				<label><input type="checkbox" name="addThree" value="wooof">dogs</label>
</td>

			<td align="left"><label><input type="checkbox" name="hasPic" value="1"> has image</label></td>
		</tr></table>
</form>
    
    <div id="map_canvas" style="width: 100%; height: 200px"></div>
    
    <form action="#" onsubmit="showLocation(); return false;">
      <div style="display=none;">
        <input style="display=none;" type="text" name="q" value="" class="address_input" size="40" />
        <input style="display=none;" type="submit" name="find" value="Add!" />

      </div>
    </form>
    <? //echo file_get_contents("http://maps.google.com/maps/geo?q=1600+Amphitheatre+Parkway,+Mountain+View,+CA&output=json&oe=utf8\&sensor=true_or_false&key=ABQIAAAAREkopdB2DthaLKWLXUcWgxRbaK9bG0DNMctUCK43VPMH1TePMRSK7uDjIaf7zr8UHIILSko5muXvTw"); ?>
    
<!--
    <a href="javascript:void(0)"
     onclick="findLocation('237 Lenox NYC NY');return false;">home</a>
    <a href="javascript:void(0)"
     onclick="findLocation('Champ de Mars 75007 Paris, France');return false;">Champ
     de Mars 75007 Paris, <b>France</b></a><br />
-->

<textarea rows="30" cols="200">

<? print_r($craig_r); ?>


</textarea>



  </body>
</html>
